package com.fosun.sprcore.tools.generatecode.template.crudmodulefile;

import org.apache.commons.lang3.StringUtils;

import com.fosun.sprcore.tools.generatecode.utils.ExtStringUtils;

public  class AdditionListSelectField{
	private String selectColumnSql;
	private String comment;
	private String javaFieldName;
	private String javaFieldNameU;
 
	
	public AdditionListSelectField(String selectColumnSql,String comment) {
		this.selectColumnSql = selectColumnSql;
		this.comment = comment;
		if(selectColumnSql!=null) {
			selectColumnSql.replaceAll("\\)", "\\) ");
		}
		String[] ss = selectColumnSql.split(" ");
		if(ss.length>0) {
			String sn = ss[ss.length-1];
			this.javaFieldName = ExtStringUtils.underlineToCamel(sn);
			this.javaFieldNameU = StringUtils.capitalize(javaFieldName);
		}
		
		
	}
	
	
 


	public String getComment() {
		return comment;
	}





	public void setComment(String comment) {
		this.comment = comment;
	}





	public String getSelectColumnSql() {
		return selectColumnSql;
	}
	public void setSelectColumnSql(String selectColumnSql) {
		this.selectColumnSql = selectColumnSql;
	}
 
	
	public String getJavaFieldName() {
		return javaFieldName;
	}
	public void setJavaFieldName(String javaFieldName) {
		this.javaFieldName = javaFieldName;
	}
	public String getJavaFieldNameU() {
		return javaFieldNameU;
	}
	public void setJavaFieldNameU(String javaFieldNameU) {
		this.javaFieldNameU = javaFieldNameU;
	}
	public static void main(String[] args) throws Exception{
		AdditionListSelectField f = new AdditionListSelectField("(SELECT a.user_name FROM spr_uuc_user a WHERE a.id=t1.user_id) user_name","用户名");
		System.out.println(f.getJavaFieldNameU());
	}
}